package com.xingongchang.baolebei.protocol;

import org.json.JSONException;
import org.json.JSONObject;
import com.external.activeandroid.Model;
import com.external.activeandroid.annotation.Column;
import com.external.activeandroid.annotation.Table;

@Table(name = "HOME_CATEGORY")
public class HOME_CATEGORY extends Model {

	@Column(name = "name")
	public String name;

	@Column(name = "categoryId")
	public int categoryId;

	@Column(name = "thumbImg")
	public String thumbImg;

	@Column(name = "cat_desc")
	public String cat_desc;

	public static HOME_CATEGORY fromJson(JSONObject jsonObject)
			throws JSONException {
		if (null == jsonObject) {
			return null;
		}

		HOME_CATEGORY localItem = new HOME_CATEGORY();


		localItem.name = jsonObject.optString("name");

		localItem.categoryId = jsonObject.optInt("id");

		localItem.thumbImg = jsonObject.optString("showImg");
		localItem.cat_desc = jsonObject.optString("cat_desc");
		return localItem;
	}


}
